#ifndef INFINITY_SERVICE_PHYSICS_H
#	define INFINITY_SERVICE_PHYSICS_H

#include "service.h"
#include "physicsobject.h"

namespace infinity {

//! @todo http://www.realtimerendering.com/intersections.html

class ServicePhysics
:	public Service
{
public : //! @name Constants
	//! @{
	static const ServiceKey Key;

	static const dw::float32 MaxSpeed;
	//! @}

public : //! @name Types definitions
	//! @{
	typedef Service super;
	//! @}

public : //! @name Commands
	//! @{
	physics::Object* createObject();
	void releaseObject(physics::Object* object);
	//! @}

protected : //! @name Service callbacks
	//! @{
	virtual void onUpdateSimulation(dw::float32 deltaT);
	//! @}

private : //! @name Construction & Destruction
	//! @{
	friend class ServiceManager;

	ServicePhysics();
	virtual ~ServicePhysics();
	//! @}

private : //! @name Types definitions
	//! @{
	typedef std::vector< physics::Object* > ObjectsCollection;
	//! @}

private : //! @name Data
	//! @{
	ObjectsCollection m_objects;
	//! @}
};

} // namespace infinity

#include "servicephysics.inl"

#endif // !INFINITY_SERVICE_PHYSICS_H
